Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first functional tests #153

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

cweiske
Copy link
Contributor

@cweiske cweiske commented Sep 6, 2024

This adds the first functional tests for aus_driver_amazon_s3.

The tests are run against a local MinIO instance that is started with the container that the tests are run in.

A prepared test-bucket is provided that MinIO can use without initial setup, which keeps test setup time low and keeps dependencies at minimum.

Some of the tests are marked skipped because they exhibit bugs that get fixed with #147.

The functional tests do not yet get automatically run on github actions since I don't know how to do that properly.

I run the tests locally with

time ./Build/Scripts/runTests.sh -p 8.2 -d sqlite -s functional -e "--display-warnings --display-notices --display-errors"

and they complete in 3 seconds.

The XDEBUG variables defined in the docker-compose.yml file command
blocks were not used under docker 20.10.24+dfsg1
with docker compose version v2.29.2.

This led to the problem that Bootstrap::init took 37 seconds,
wasting developer time.

By switching to "export" calls, the variables get set properly
and php/xdebug runs fast. A single functional test run is 3 seconds now.
based on the files in Tests/Functional/Bucketfiles/
Created with the Build/testing-docker/prepare-minio-data.sh

Committed here so that "mc" (minio client) is not needed
to run the tests.
./Build/Scripts/runTests.sh -p 8.2 -d sqlite -s functional -e "--display-warnings --display-notices --display-errors"
We use a local minio instance to run the tests against.

Run them with
./Build/Scripts/runTests.sh -p 8.2 -d sqlite -s functional -e "--display-warnings --display-notices --display-errors"
@cweiske
Copy link
Contributor Author

cweiske commented Sep 9, 2024

I've added the functional tests to the github actions file, but they do not run automatically:

This scheduled workflow is disabled because there hasn't been activity in this repository for at least 60 days. Enable this workflow to resume scheduled runs.

- amend commit to trigger build
ubuntu-20.04 brings an error:
> Run Build/Scripts/runTests.sh -p 8.0 -s composerInstall
> Build/Scripts/runTests.sh: line 107: type: docker-compose: not found
> This script relies on docker and docker-compose. Please install
.. typo3/testing-framework 8 needs a higher version
@cweiske
Copy link
Contributor Author

cweiske commented Sep 9, 2024

The tests run!

@weakbit weakbit added the 8.1 label Oct 1, 2024
@weakbit
Copy link
Contributor

weakbit commented Oct 4, 2024

Thank you @cweiske
I changed some of the scripts around the tests (minio setup) and others and would provide an other pullrequest you can take a look at and have an opionion about to get the best of both.
With that i look forward to extend the functional tests a lot to cover most code in future.

@cweiske
Copy link
Contributor Author

cweiske commented Oct 14, 2024

Ok, where is the new PR?

@weakbit
Copy link
Contributor

weakbit commented Oct 14, 2024

@cweiske

I pushed it to https://github.com/andersundsehr/aus_driver_amazon_s3/tree/functional-tests-alternative
the idea i had was to update to recent test scripts from the actual blog_example and to create the minio data on test runtime so its easier to change its content.

feel free to tell me if there are reasons not to do as i did.

@cweiske
Copy link
Contributor Author

cweiske commented Oct 14, 2024

Did you change my commits? I don't see any commits of yours.

I used a set of predefined files in minio because that makes the test runs faster.

@weakbit
Copy link
Contributor

weakbit commented Oct 14, 2024

@cweiske you are right. the commit did not succeed it is now added.

i hope i have some time soon to get things together and have a master merge

@cweiske
Copy link
Contributor Author

cweiske commented Dec 10, 2024

@weakbit could you please merge the tests as they are, so that the other patches can use the tests as base?

I understand if you want to change things, but they do work as they are.
If you don't have time to rework them now, merge my code and rework it later.

Having non-optimal tests now is better than perfect ones in 3 year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants